<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>用户注册</title>
<link rel="stylesheet" type="text/css" href="./css/login.css">
<script
	src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
	<form method="post"
		action="${pageContext.request.contextPath}/registerUser">
		<div class="regist">
			<div class="regist_center">
				<div class="regist_top">
					<div class="left fl">会员注册</div>
					<div class="right fr">
						<a href="./index.html" target="_self">小米商城</a>
					</div>
					<div class="clear"></div>
					<div class="xian center"></div>
				</div>
				<div class="regist_main center">
					<div class="username">
						用&nbsp;&nbsp;户&nbsp;&nbsp;名:&nbsp;&nbsp;<input class="shurukuang"
							type="text" name="Uname" placeholder="请输入你的用户名" /><span>请不要输入汉字</span>
					</div>
					<div class="username">
						密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码:&nbsp;&nbsp;<input
							class="shurukuang" type="password" name="Passwd"
							placeholder="请输入你的密码" /><span>请输入6位以上字符</span>
					</div>

					<div class="username">
						确认密码:&nbsp;&nbsp;<input class="shurukuang" type="password"
							name="repassword" placeholder="请确认你的密码" /><span>两次密码要输入一致哦</span>
					</div>
					<div class="username">
						手&nbsp;&nbsp;机&nbsp;&nbsp;号:&nbsp;&nbsp;<input class="shurukuang"
							type="text" name="Phone" placeholder="请填写正确的手机号" /><span>填写下手机号吧，方便我们联系您！</span>
					</div>
					<div class="username">
						<div class="left fl">
							验&nbsp;&nbsp;证&nbsp;&nbsp;码:&nbsp;&nbsp;<input class="yanzhengma"
								type="text" name="code" placeholder="请输入验证码" />
						</div>
						<div class="right fl">
							<img id="codeImg" alt="验证码" src="${ctx}/code"
								onclick="changeImg()">
						</div>
						<div class="clear"></div>
					</div>
				</div>
				<div class="regist_submit">
					<input class="submit" type="submit" name="submit" value="立即注册">
				</div>

			</div>
		</div>
	</form>
</body>
<script type="text/javascript">
		function changeImg() {
	        var imgSrc = $("#codeImg");
	        var src = imgSrc.attr("src");
	        imgSrc.attr("src", chgUrl(src));
	    }  
	
	　　 //加入时间戳，去缓存机制   
	    function chgUrl(url) {
	        var timestamp = (new Date()).valueOf();if ((url.indexOf("&") >= 0)) {
	            url = url + "&timestamp=" + timestamp;
	        } else {
	            url = url + "?timestamp=" + timestamp;
	        }
	        return url;
	    }
	</script>
</html>